package com.uzai.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 电商平台域名
 * @Auther: jianghan
 * @Date: 2021/8/14 16:45
 * @Description:
 */
public enum LeaDomainKeyEnum {
    /**
     * 淘宝域名列表
     */
    TAOBAO_DOMAIN_LIST("TAOBAO_DOMAIN_LIST","淘宝域名列表"),
    /**
     * 京东域名列表
     */
    JD_DOMAIN_LIST("JD_DOMAIN_LIST","京东域名列表"),
    /**
     * 拼多多域名列表
     */
    PDD_DOMAIN_LIST("PDD_DOMAIN_LIST","拼多多域名列表"),
    /**
     * 唯品会域名列表
     */
    VPH_DOMAIN_LIST("VPH_DOMAIN_LIST","唯品会域名列表");

    private String key;
    private String desc;
    LeaDomainKeyEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }
    public String getKey() {
        return key;
    }
    public String getDesc() {
        return desc;
    }

    public static LeaDomainKeyEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (LeaDomainKeyEnum type: LeaDomainKeyEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
